Skip to content

fix: Allow ToC to scroll independently of page content #7754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

utkarsh125
Copy link
Contributor

Description

Fixed the issue of the Table of Contents (ToC) being statically positioned. The ToC now scrolls to the top under the heading instead of being sticky. Adjustments were made to ensure it blends seamlessly with the article layout at
/en/download/package-manager/all

fixes: #7740

Files Changed

packages/ui-components/Containers/MetaBar/index.tsx

packages/ui-components/Containers/MetaBar/index.module.css

Validation

Verified that the ToC no longer remains sticky and is correctly positioned beneath the article heading.

Confirmed visual alignment for larger screens
No regressions observed in MetaBar behavior

Video

ToC.Fix-1747407308773.mp4

Related Issues

fixes: #7740

Check List

I have read the Contributing Guidelines and made commit messages that follow the guideline.

  • I have run pnpm format to ensure the code follows the style guide.

  • I have run pnpm test to check if all tests are passing.

  • I have run pnpm build to check if the website builds without errors.

  • I've covered newly added functionality with unit tests if necessary.

@utkarsh125 utkarsh125 requested a review from a team as a code owner May 16, 2025 18:37
Copy link

vercel bot commented May 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview May 28, 2025 8:38am

Copy link
Contributor

github-actions bot commented May 18, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟠 85 🟢 100 🟢 100 🟢 91 🔗
/en/about 🟢 100 🟢 100 🟢 100 🟠 82 🔗
/en/about/previous-releases 🟢 100 🟢 100 🟢 100 🟠 83 🔗
/en/download 🟢 98 🟢 100 🟢 100 🟢 91 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🟢 92 🔗

@codecov-commenter
Copy link

codecov-commenter commented May 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.32%. Comparing base (d122e58) to head (6d782d1).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7754      +/-   ##
==========================================
- Coverage   75.35%   75.32%   -0.04%     
==========================================
  Files          96       96              
  Lines        7861     7861              
  Branches      192      192              
==========================================
- Hits         5924     5921       -3     
- Misses       1936     1939       +3     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@avivkeller
Copy link
Member

Can you please check the visual regression: https://www.chromatic.com/test?appId=64c7d71358830e9105808652&id=6829e0dcf23a597de1aee02b

@utkarsh125
Copy link
Contributor Author

Can you please check the visual regression: https://www.chromatic.com/test?appId=64c7d71358830e9105808652&id=6829e0dcf23a597de1aee02b

@avivkeller I did make some changes, although I do not know how to test it. Can you let me know how can I test the chromatic diffs?

@utkarsh125
Copy link
Contributor Author

The issue is probably because of the added padding

@avivkeller

I have removed the additional p-4 from
maybe this will solve the issue, I had added it to give more space to the Metabar from the bottom, I hope this can fix it.

also, I was talking about this specific link that you sent, how can I obtain it for the latest build?
https://www.chromatic.com/test?appId=64c7d71358830e9105808652&id=6829e0dcf23a597de1aee02b

This thing was pretty helpful because of the comparative visuals.

&:last-child {
      @apply mb-0
          p-4 <-------
    }

@utkarsh125
Copy link
Contributor Author

I think the chromatic diff is showing up because of sticky scroll bar, and in order to make sure the MetaBar isn't too small, I had changed the max-height to give some scrolling space to the wrapper in the MetaBar

@ovflowd
Copy link
Member

ovflowd commented May 25, 2025

@avivkeller are you happy with the state of the PR?

@ovflowd
Copy link
Member

ovflowd commented May 25, 2025

Something really odd happened with this preview? https://nodejs-org-git-fork-utkarsh125-allow-toc-to-scrol-cd0e20-openjs.vercel.app/en

@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label May 25, 2025
@avivkeller
Copy link
Member

Something really odd happened with this preview? https://nodejs-org-git-fork-utkarsh125-allow-toc-to-scrol-cd0e20-openjs.vercel.app/en

What? You can't read that? 🤣

@utkarsh125
Copy link
Contributor Author

@ovflowd
Copy link
Member

ovflowd commented May 25, 2025

Something really odd happened with this preview? https://nodejs-org-git-fork-utkarsh125-allow-toc-to-scrol-cd0e20-openjs.vercel.app/en

What? You can't read that? 🤣

As far as I know I haven't updated my certification on Gebrish 😋

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT ! Thanks for your first contribution

Copy link
Collaborator

@bmuenzenmeyer bmuenzenmeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks!

@bmuenzenmeyer bmuenzenmeyer enabled auto-merge May 28, 2025 11:18
@bmuenzenmeyer bmuenzenmeyer added the github_actions:pull-request Trigger Pull Request Checks label May 28, 2025
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label May 28, 2025
@bmuenzenmeyer bmuenzenmeyer added this pull request to the merge queue May 28, 2025
Merged via the queue into nodejs:main with commit f349d7e May 28, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow ToC to scroll independently of page content
6 participants